package com.jshare.dao;

import java.util.List;

import com.jshare.entity.News;

public interface NewsDAO {

	//property constants
	public static final String TITLE = "title";
	public static final String CONTENT = "content";
	public static final String AUTHOR = "author";
	public static final String FROM = "from";

	public abstract void save(News transientInstance);

	public abstract void delete(News persistentInstance);

	public abstract News findById(java.lang.Integer id);

	public abstract List findByExample(News instance);

	public abstract List findByProperty(String propertyName, Object value);

	public abstract List findByTitle(Object title);

	public abstract List findByContent(Object content);

	public abstract List findByAuthor(Object author);

	public abstract List findByFrom(Object from);

	public abstract List findAll();

	public abstract News merge(News detachedInstance);

	public abstract void attachDirty(News instance);

	public abstract void attachClean(News instance);
	
	public abstract List findAllTitle();

	///definate
	
	public List getPage(String sql, int firstRow,int maxRow); 
	public int getTotalRows(String sql);
}